# Contributor: Simon Zeni <simon@bl4ckb0ne.ca>
# Maintainer: Simon Zeni <simon@bl4ckb0ne.ca>
pkgname=vulkan-validation-layers
_pkgname=Vulkan-ValidationLayers
pkgver=1.3.216.0
_pkgver=sdk-$pkgver
pkgrel=0
pkgdesc="Vulkan Validation Layers"
url="https://www.khronos.org/vulkan/"
arch="all"
license="Apache-2.0"
makedepends="
	cmake
	libx11-dev
	libxcb-dev
	libxrandr-dev
	ninja
	python3
	robin-hood-hashing
	spirv-headers
	spirv-tools-dev
	vulkan-headers
	wayland-dev
	"
subpackages="$pkgname-dbg $pkgname-static $pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/$_pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$_pkgver"
options="!check" # test segfaults

build() {
	cmake -B build -G Ninja -Wno-dev \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_INSTALL_DATAROOTDIR=/usr/share \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DBUILD_LAYER_SUPPORT_FILES=ON \
		-DBUILD_WSI_XCB_SUPPORT=ON \
		-DBUILD_WSI_XLIB_SUPPORT=ON \
		-DBUILD_WSI_WAYLAND_SUPPORT=ON \
		-DBUILD_WERROR=OFF

	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
c3e3f44ddec4a440c759a5773cf8cabdb79e35152fd912b75ba7ef80126184fab7d0cd93e55e6f0a1b3fa5379295bf60dd21cbba97b3c24e753cd7b6ccb78f72  vulkan-validation-layers-1.3.216.0.tar.gz
"
